#pragma once

#include "DirectXBase.h"
#include "DisplayContext.h"
class DisplayItem;
// This class renders simple text with a colored background.
class DisplayEngine : public DirectXBase
{
public:
	DisplayEngine();
	~DisplayEngine();

	void InitializeWithFrame(float width,float height);
	void AddImage(float x,float y,float width,float height,Windows::Storage::StorageFile^ file);
	void AddRect(float x,float y,float width,float height,UINT32 borderColor=0xffffffff,UINT32 fillColor=0xffffffff,float borderThickness=0);

	void AppendDisplayItem(DisplayItem* item);
	// DirectXBase methods.
	virtual void Initialize(Windows::UI::Core::CoreWindow^ window, Windows::UI::Xaml::Controls::SwapChainBackgroundPanel^ panel, float dpi) override;
	virtual void CreateDeviceIndependentResources() override;
	virtual void CreateDeviceResources() override;
	virtual void CreateWindowSizeDependentResources() override;
	virtual void Render() override;

	DisplayContext Context;
private:
	float m_frameWidth;
	float m_frameHeight;

	std::vector<DisplayItem*> m_displayItems;
};
